﻿using System;
using System.Collections.Generic;

using System.Text;
using OpenCvSharp;
using System.IO;


namespace RecognitionNumbers
{
    public class Image
    {
        private OpenCvSharp.IplImage image_;


        public Image(string file)
        {
            URL = file;
        }

        public Image(IplImage image)
        {
            image_=image;
        }

        public OpenCvSharp.IplImage image
        {
            get
            {
                return image_;
            }
            set
            {
                image_ = value;
            }
        }

        public string URL
        {
            set
            {
                if (File.Exists(value))
                image_ = new IplImage(value, LoadMode.Color); 
            }
        }

        public System.Drawing.Image bitmap
        {
            get
            {
               return  image_.ToBitmap();
            }
        }
    }
}
